﻿<Window x:Class="RandomReminder.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:RandomReminder"
        xmlns:properties="clr-namespace:RandomReminder.Properties"
    Title="MainWindow" Height="500" Width="500">
    
    <Window.Resources>
        <Style TargetType="ProgressBar" x:Key="CircularProgressBarStyle">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ProgressBar">
                        <Grid x:Name="LayoutRoot">
                            <!-- attach the view model -->
                            <local:CircularProgressBarViewModel.Attach>
                                <local:CircularProgressBarViewModel HoleSizeFactor="0.75"/>
                            </local:CircularProgressBarViewModel.Attach>


                            <Ellipse Width="{Binding Diameter}" Height="{Binding Diameter}"
                       HorizontalAlignment="Center" VerticalAlignment="Center"
                       Stroke="LightGray" Opacity="0.5" Fill="Transparent"
                       StrokeThickness="10">
                            </Ellipse>

                            <local:PiePiece CentreX="{Binding CentreX}" CentreY="{Binding CentreY}"
                              RotationAngle="0" WedgeAngle="{Binding Angle}"
                              Radius="{Binding Radius}" InnerRadius="{Binding InnerRadius}"
                              Fill="Black" Opacity="0.7"/>

                            <!--<Grid local:GridUtils.RowDefinitions="*,2*,*" local:GridUtils.ColumnDefinitions="*,2*,*">
                                <Viewbox Grid.Row="1" Grid.Column="1">
                                    <TextBlock Text="{Binding Percent, StringFormat=0%}"
                             Foreground="Black"
                             FontWeight="Bold"
                             VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                </Viewbox>
                            </Grid>-->
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="TextBlock" x:Key="ImportantText">
            <Setter Property="TextBlock.Foreground" Value="Red" />
        </Style>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="*" />
            <RowDefinition Height="100" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="30" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="30" />
        </Grid.ColumnDefinitions>
        <ProgressBar Grid.Row="1" Grid.Column="1" Value="{Binding Value}" Style="{StaticResource CircularProgressBarStyle}" Width="Auto" />
        <Grid Grid.Row="1" Grid.Column="1" local:GridUtils.RowDefinitions="*,2*,*" local:GridUtils.ColumnDefinitions="*,2*,*">
            <Viewbox Grid.Row="1" Grid.Column="1">
                <TextBlock Text="0:00" Name="TimeText"
                    Foreground="Black"
                    FontWeight="Bold"
                    VerticalAlignment="Center" HorizontalAlignment="Center" />
            </Viewbox>
        </Grid>
        <Button Content="Start" FontSize="18" Grid.Column="1" Grid.Row="2" Height="50" HorizontalAlignment="Center" Margin="0,38,0,0" Name="startButton" VerticalAlignment="Top" Width="100" Click="startButton_Click" />
        <Label Content="Minimum" Grid.Column="1" Height="28" HorizontalAlignment="Left" Margin="0,23,0,0" Name="minimumLabel" VerticalAlignment="Top" />
        <TextBox Text="{Binding Source={x:Static properties:Settings.Default}, Path=MinMinutes, Mode=TwoWay}" Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="0,46,0,0" Name="minimumText" VerticalAlignment="Top" Width="120" />
        <Label Content="Maximum" Grid.Column="1" Height="28" HorizontalAlignment="Right" Margin="0,23,57,0" Name="maximumLabel" VerticalAlignment="Top" />
        <TextBox Text="{Binding Source={x:Static properties:Settings.Default}, Path=MaxMinutes, Mode=TwoWay}" Grid.Column="1" Height="23" HorizontalAlignment="Right" Margin="0,46,0,0" Name="maximumText" VerticalAlignment="Top" Width="120" />
    </Grid>
</Window>
